#include "sdkGlobal.h"
#include "platform_global.h"
#include "platform_qrcode.h"

typedef struct
{
    TransmitQrcodeScannerFunc mQrcodeScannerFunc;
    TransmitQrcodeCreateFunc mQrcodeCreateFunc;
    TransmitQrcodeScannerQueryFunc mQrcodeScannerQueryFunc;
    TransmitQrcodeCreateQueryFunc mQrcodeCreateQueryFunc;
    ShowWaitScannerQueryViewFunc mShowWaitScannerQueryViewFunc;
    ShowCreateQueryingViewFunc mShowCreateQueryViewFunc;
    ShowQrCodeViewFunc mShowQrCodeViewFunc;
    ShowQrCodeCreateViewFunc mShowCreateViewFunc;
    UpdateQrCodeTransEntityByRecvData mUpdateRecordFunc;
    TransShowPlatformFunc mTransShowFunc;
    RecordPlatformFunc mRecordPlatformFunc;
    TransmitDataPlatformFunc mTransmitDataPlatformFunc;
    IsScannerPayingFunc mIsScannerPayingFunc;
    IsQrcodePayingFunc mIsQrcodePayingFunc;
    QrcodePayStatusFunc mQrcodePayStatusFunc;
} platform_qrcode_entity;

static platform_qrcode_entity g_platform_qrcode_entity;

void platform_qrcode_init()
{
    memset(&g_platform_qrcode_entity, 0x00, sizeof(platform_qrcode_entity));
}

void platform_qrcode_set_transmit_qrcode_scanner_func(TransmitQrcodeScannerFunc func)
{
    g_platform_qrcode_entity.mQrcodeScannerFunc = func;
}

TransmitQrcodeScannerFunc platform_qrcode_get_transmit_qrcode_scanner_func()
{
    return g_platform_qrcode_entity.mQrcodeScannerFunc;
}

void platform_qrcode_set_transmit_qrcode_create_func(TransmitQrcodeCreateFunc func)
{
    g_platform_qrcode_entity.mQrcodeCreateFunc = func;
}

TransmitQrcodeCreateFunc platform_qrcode_get_transmit_qrcode_create_func()
{
    return g_platform_qrcode_entity.mQrcodeCreateFunc;
}

void platform_qrcode_set_transmit_qrcode_scanner_query_func(TransmitQrcodeScannerQueryFunc func)
{
    g_platform_qrcode_entity.mQrcodeScannerQueryFunc = func;
}

TransmitQrcodeScannerQueryFunc platform_qrcode_get_transmit_qrcode_scanner_query_func()
{
    return g_platform_qrcode_entity.mQrcodeScannerQueryFunc;
}

void platform_qrcode_set_transmit_qrcode_create_query_func(TransmitQrcodeCreateQueryFunc func)
{
    g_platform_qrcode_entity.mQrcodeCreateQueryFunc = func;
}

TransmitQrcodeCreateQueryFunc platform_qrcode_get_transmit_qrcode_create_query_func()
{
    return g_platform_qrcode_entity.mQrcodeCreateQueryFunc;
}

void platform_qrcode_set_show_func(TransShowPlatformFunc *flowFunc)
{
    memcpy(&g_platform_qrcode_entity.mTransShowFunc, flowFunc, sizeof(TransShowPlatformFunc));
}

TransShowPlatformFunc *platform_qrcode_get_show_func()
{
    return &g_platform_qrcode_entity.mTransShowFunc;
}

void platform_qrcode_set_transmit_data_func(TransmitDataPlatformFunc *platformFunc)
{
    memcpy(&g_platform_qrcode_entity.mTransmitDataPlatformFunc, platformFunc, sizeof(TransmitDataPlatformFunc));
}

TransmitDataPlatformFunc *platform_qrcode_get_transmit_data_func()
{
    return &g_platform_qrcode_entity.mTransmitDataPlatformFunc;
}

void platform_qrcode_set_record_func(RecordPlatformFunc *platformFunc)
{
    memcpy(&g_platform_qrcode_entity.mRecordPlatformFunc, platformFunc, sizeof(RecordPlatformFunc));
}

RecordPlatformFunc *platform_qrcode_get_record_func()
{
    return &g_platform_qrcode_entity.mRecordPlatformFunc;
}

void platform_qrcode_set_scanner_query_view_func(ShowWaitScannerQueryViewFunc func)
{
    g_platform_qrcode_entity.mShowWaitScannerQueryViewFunc = func;
}

ShowWaitScannerQueryViewFunc platform_qrcode_get_scanner_query_view_func()
{
    return g_platform_qrcode_entity.mShowWaitScannerQueryViewFunc;
}

void platform_qrcode_set_show_create_view_func(ShowQrCodeCreateViewFunc func)
{
    g_platform_qrcode_entity.mShowCreateViewFunc = func;
}

ShowQrCodeCreateViewFunc platform_qrcode_get_show_create_view_func()
{
    return g_platform_qrcode_entity.mShowCreateViewFunc;
}

void platform_qrcode_set_update_record_func(UpdateQrCodeTransEntityByRecvData func)
{
    g_platform_qrcode_entity.mUpdateRecordFunc = func;
}

UpdateQrCodeTransEntityByRecvData platform_qrcode_get_update_record_func()
{
    return g_platform_qrcode_entity.mUpdateRecordFunc;
}

void platform_qrcode_set_create_query_view_func(ShowCreateQueryingViewFunc func)
{
    g_platform_qrcode_entity.mShowCreateQueryViewFunc = func;
}

ShowCreateQueryingViewFunc platform_qrcode_get_create_query_view_func()
{
    return g_platform_qrcode_entity.mShowCreateQueryViewFunc;
}

void platform_qrcode_set_show_view_func(ShowQrCodeViewFunc func)
{
    g_platform_qrcode_entity.mShowQrCodeViewFunc = func;
}

ShowQrCodeViewFunc platform_qrcode_get_show_view_func()
{
    return g_platform_qrcode_entity.mShowQrCodeViewFunc;
}

void platform_qrcode_set_is_scanner_paying_func(IsScannerPayingFunc func)
{
    g_platform_qrcode_entity.mIsScannerPayingFunc = func;
}

IsScannerPayingFunc platform_qrcode_get_is_scanner_paying_func()
{
    return g_platform_qrcode_entity.mIsScannerPayingFunc;
}

void platform_qrcode_set_is_qrcode_paying_func(IsQrcodePayingFunc func)
{
    g_platform_qrcode_entity.mIsQrcodePayingFunc = func;
}

IsQrcodePayingFunc platform_qrcode_get_is_qrcode_paying_func()
{
    return g_platform_qrcode_entity.mIsQrcodePayingFunc;
}

void platform_qrcode_set_pay_status_func(QrcodePayStatusFunc func)
{
    g_platform_qrcode_entity.mQrcodePayStatusFunc = func;
}

QrcodePayStatusFunc platform_qrcode_get_pay_status_func()
{
    return g_platform_qrcode_entity.mQrcodePayStatusFunc;
}